#include "Levels.h"
Levels::Levels()
{
	levelStrArr.resize(LEVEL_NUM);//
	//data=new CCFileData();
	//unsigned char data[14784];
	unsigned long  ct;
	unsigned char* pchar=CCFileUtils::sharedFileUtils()->getFileData(CCFileUtils::sharedFileUtils()->fullPathFromRelativePath("levels.txt"), "r", &ct); 
	//return initWithImageData(data.getBuffer(), data.getSize(), eImgFmt);
	//data;
	//int ct=data->getSize();
	int index=0;
	this->levelStrArr[index]=pchar;
	for(int i=0;i<ct;i++)
	{
		//unsigned char c=*(pchar+i);
		if(*(pchar+i)=='\n' && *(pchar+i+1)=='\n' && *(pchar+i+2)=='\n')
		{
			index++;
			if(i+30<ct)//level txx len >30
				this->levelStrArr[index]=pchar+i+3;
			else
				break;
		}
	}
}
Levels::~Levels()
{
	//delete data;
}
